home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / VGADOC4B.ZIP / VGABIOS.TXT < prev    next >
Text File  |  1995-09-29  |  39KB  |  837 lines

  1. ----------1000-------------------------------
  2. INT 10 - VIDEO - SET VIDEO MODE
  3.         AH = 00h
  4.         AL = mode (see below)
  5. Return: AL = video mode flag (Phoenix BIOS)
  6.              20h mode > 7
  7.              30h modes <= 7 except mode 6
  8.              3Fh mode 6
  9.         AL = CRT controller mode byte (Phoenix 386 BIOS v1.10)
  10. Note: IBM standard modes do not clear the screen if the high bit of AL is set
  11.       (EGA or higher only)
  12.  
  13. Values for video mode:
  14.      text/ text   pixel pixel    colors  display  scrn system
  15.      grph  resol  box   resoltn          pages   addr
  16.  00h = T   40x25  8x14           16gray     8    B800 EGA
  17.      = T   40x25  8x16             16       8    B800 MCGA
  18.      = T   40x25  9x16             16       8    B800 VGA
  19.  01h = T   40x25  8x14             16       8    B800 EGA
  20.      = T   40x25  8x16             16       8    B800 MCGA
  21.      = T   40x25  9x16             16       8    B800 VGA
  22.  02h = T   80x25  8x14           16gray     4    B800 EGA
  23.      = T   80x25  8x16             16       4    B800 MCGA
  24.      = T   80x25  9x16             16       4    B800 VGA
  25.  03h = T   80x25  8x14             16       4    B800 EGA
  26.      = T   80x25  8x16             16       4    B800 MCGA
  27.      = T   80x25  9x16             16       4    B800 VGA
  28.  04h = G   40x25  8x8     320x200           4    B800 CGA,PCjr,EGA,MCGA,VGA
  29.  05h = G   40x25  8x8     320x200 4gray          B800 CGA,PCjr,EGA
  30.      = G   40x25  8x8     320x200   4            B800 MCGA,VGA
  31.  06h = G   80x25  8x8     640x200   2            B800 CGA,PCjr,EGA,MCGA,VGA
  32.  07h = T   80x25  9x14            mono     var   B000 MDA,Hercules,EGA
  33.      = T   80x25  9x16            mono           B000 VGA
  34.  0Bh =                 reserved (used internally by EGA BIOS)
  35.  0Ch =                 reserved (used internally by EGA BIOS)
  36.  0Dh = G   40x25  8x8     320x200  16       8    A000 EGA,VGA
  37.  0Eh = G   80x25  8x8     640x200  16       4    A000 EGA,VGA
  38.  0Fh = G   80x25  8x14    640x350 mono      2    A000 EGA,VGA
  39.  10h = G   80x25  8x14    640x350   4       2    A000 64k EGA
  40.      = G                  640x350  16            A000 256k EGA,VGA
  41.  11h = G   80x30  8x16    640x480 mono           A000 VGA,MCGA,ATI EGA,ATI VIP
  42.  12h = G   80x30  8x16    640x480 16/256k        A000 VGA,ATI VIP
  43.      = G   80x30  8x16    640x480 16/64          A000 ATI EGA Wonder
  44.  13h = G   40x25  8x8     320x200 256/256k       A000 VGA,MCGA,ATI VIP
  45. ----------1001-------------------------------
  46. INT 10 - VIDEO - SET TEXT-MODE CURSOR SHAPE
  47.         AH = 01h
  48.         CH = bit 7    should be zero
  49.              bits 6,5 cursor blink
  50.                 (00=normal, 01=invisible, 10=erratic, 11=slow)
  51.                 (00=normal, other=invisible on EGA/VGA)
  52.              bits 4-0 top scan line containing cursor
  53.         CL = bottom scan line containing cursor (bits 0-4)
  54. Notes: buggy on EGA systems--BIOS remaps cursor shape in 43 line modes, but
  55.        returns unmapped cursor shape
  56.        applications which wish to change the cursor by programming the
  57.        hardware directly on EGA or above should call INT 10/AX=1130h or
  58.        read 0040h:0085h first to determine the current font height
  59. BUG:   AMI 386 BIOS and AST Premier 386 BIOS will lock up the system if AL
  60.        is not equal to the current video mode
  61. ----------1002-------------------------------
  62. INT 10 - VIDEO - SET CURSOR POSITION
  63.         AH = 02h
  64.         BH = page number
  65.               0-3 in modes 2&3
  66.               0-7 in modes 0&1
  67.                 0 in graphics modes
  68.         DH = row (00h is top)
  69.         DL = column (00h is left)
  70. ----------1003-------------------------------
  71. INT 10 - VIDEO - GET CURSOR POSITION AND SIZE
  72.         AH = 03h
  73.         BH = page number
  74.               0-3 in modes 2&3
  75.               0-7 in modes 0&1
  76.                 0 in graphics modes
  77. Return: AX = 0000h (Phoenix BIOS)
  78.         CH = start scan line
  79.         CL = end scan line
  80.         DH = row (00h is top)
  81.         DL = column (00h is left)
  82. Notes: a separate cursor is maintained for each of up to 8 display pages
  83.        many ROM BIOSes incorrectly return the default size for a color display
  84.        (start 06h, end 07h) when a monochrome display is attached
  85. ----------1004-------------------------------
  86. INT 10 - VIDEO - READ LIGHT PEN POSITION (EGA Only)
  87.         AH = 04h
  88. Return: AH = light pen trigger flag
  89.              00h not down/triggered
  90.              01h down/triggered
  91.         DH,DL = row,column of character light pen is on
  92.         CH = pixel row (graphics modes 04h-06h)
  93.         CX = pixel row (graphics modes with >200 rows)
  94.         BX = pixel column
  95. Notes: on a CGA, returned column numbers are always multiples of 2 (320-
  96.        column modes) or 4 (640-column modes)
  97.        returned row numbers are only accurate to two lines
  98. ----------1005-------------------------------
  99. INT 10 - VIDEO -  SELECT ACTIVE DISPLAY PAGE
  100.         AH = 05h
  101.         AL = new page number (00h to number of pages - 1) (see AH=00h)
  102. ----------1006-------------------------------
  103. INT 10 - VIDEO - SCROLL UP WINDOW
  104.         AH = 06h
  105.         AL = number of lines by which to scroll up (00h = clear entire window)
  106.         BH = attribute used to write blank lines at bottom of window
  107.      CH,CL = row,column of window's upper left corner
  108.      DH,DL = row,column of window's lower right corner
  109. Note:  affects only the currently active page (see AH=05h)
  110. Warning: some implementations have a bug which destroys BP
  111. ----------1007-------------------------------
  112. INT 10 - VIDEO - SCROLL DOWN WINDOW
  113.         AH = 07h
  114.         AL = number of lines by which to scroll down (00h=clear entire window)
  115.         BH = attribute used to write blank lines at top of window
  116.      CH,CL = row,column of window's upper left corner
  117.      DH,DL = row,column of window's lower right corner
  118. Note:  affects only the currently active page (see AH=05h)
  119. Warning: some implementations have a bug which destroys BP
  120. ----------1008-------------------------------
  121. INT 10 - VIDEO - READ CHARACTER AND ATTRIBUTE AT CURSOR POSITION
  122.         AH = 08h
  123.         BH = page number (00h to number of pages - 1) (see AH=00h)
  124. Return: AH = attribute
  125.              bit    7: blink
  126.              bits 6-4: background color
  127.                        000 black
  128.                        001 blue
  129.                        010 green
  130.                        011 cyan
  131.                        100 red
  132.                        101 magenta
  133.                        110 brown
  134.                        111 white
  135.              bits 3-0: foreground color
  136.                        0000 black       1000 dark grey
  137.                        0001 blue        1001 light blue
  138.                        0010 green       1010 light green
  139.                        0011 cyan        1011 light cyan
  140.                        0100 red         1100 light red
  141.                        0101 magenta     1101 light magenta
  142.                        0110 brown       1110 yellow
  143.                        0111 light grey  1111 white
  144.         AL = character
  145. Notes: for monochrome displays, a foreground of 1 with background 0 is
  146.        underlined the blink bit may be reprogrammed to enable intense
  147.        background colors using AX=1003h or by programming the CRT controller
  148. ----------1009-------------------------------
  149. INT 10 - VIDEO - WRITE CHARACTER AND ATTRIBUTE AT CURSOR POSITION
  150.         AH = 09h
  151.         AL = character to display
  152.         BH = page number (00h to number of pages - 1) (see AH=00h)
  153.         BL = attribute (text mode) or color (graphics mode)
  154.              if bit 7 set in graphics mode, character is xor'ed onto screen
  155.         CX = number of times to write character
  156. Notes: all characters are displayed, including CR, LF, and BS
  157.        replication count in CX may produce an unpredictable result in graphics
  158.        modes if it is greater than the number of positions remaining in the
  159.        current row
  160. ----------100A-------------------------------
  161. INT 10 - VIDEO - WRITE CHARACTER ONLY AT CURSOR POSITION
  162.         AH = 0Ah
  163.         AL = character to display
  164.         BH = page number (00h to number of pages - 1) (see AH=00h)
  165.         BL = attribute (PCjr only) or color (graphics mode)
  166.              if bit 7 set in graphics mode, character is xor'ed onto screen
  167.         CX = number of times to write character
  168. Notes: all characters are displayed, including CR, LF, and BS
  169.        replication count in CX may produce an unpredictable result in graphics
  170.        modes if it is greater than the number of positions remaining in the
  171.        current row
  172. ----------100B--BH00-------------------------
  173. INT 10 - VIDEO - SET BACKGROUND/BORDER COLOR
  174.         AH = 0Bh
  175.         BH = 00h
  176.         BL = background/border color (border only in text modes)
  177. ----------100B--BH01-------------------------
  178. INT 10 - VIDEO - SET PALETTE
  179.         AH = 0BH
  180.         BH = 01h
  181.         BL = palette ID
  182.              00h background, green, red, and brown/yellow
  183.              01h background, cyan, magenta, and white
  184. ----------100C-------------------------------
  185. INT 10 - VIDEO - WRITE GRAPHICS PIXEL
  186.         AH = 0Ch
  187.         BH = page number
  188.         AL = pixel color (if bit 7 set, value is xor'ed onto screen)
  189.         CX = column
  190.         DX = row
  191. Notes: valid only in graphics modes
  192.        BH is ignored if the current video mode supports only one page
  193. ----------100D-------------------------------
  194. INT 10 - VIDEO - READ GRAPHICS PIXEL
  195.         AH = 0Dh
  196.         BH = page number
  197.         CX = column
  198.         DX = row
  199. Return: AL = pixel color
  200. Notes: valid only in graphics modes
  201.        BH is ignored if the current video mode supports only one page
  202. ----------100E-------------------------------
  203. INT 10 - VIDEO - TELETYPE OUTPUT
  204.         AH = 0Eh
  205.         AL = character to write
  206.         BH = page number
  207.         BL = foreground color (graphics modes only)
  208. Notes: characters 07h (BEL), 08h (BS), 0Ah (LF), and 0Dh (CR) are interpreted
  209.        and do the expected things
  210.        IBM PC ROMs dated 4/24/81 and 10/19/81 require that BH be the same as
  211.        the current active page
  212. ----------100F-------------------------------
  213. INT 10 - VIDEO - GET CURRENT VIDEO MODE
  214.         AH = 0Fh
  215. Return: AH = number of character columns
  216.         AL = display mode (see AH=00h)
  217.         BH = active page (see AH=05h)
  218. Notes: if mode was set with bit 7 set ("no blanking"), the returned mode will
  219.        also have bit 7 set
  220.        EGA and VGA return either AL=03h (color) or AL=07h (monochrome) in all
  221.        extended-row text modes
  222. ----------101000----------------------------
  223. INT 10 - VIDEO - SET SINGLE PALETTE REGISTER (PCjr,EGA,MCGA,VGA)
  224.         AX = 1000h
  225.         BL = palette register number (00h-0Fh)
  226.            = attribute register number (undocumented)
  227.              10h attribute mode control register (should let BIOS control
  228.                  this)
  229.              11h overscan color register (see also AX=1001h)
  230.              12h color plane enable register (bits 3-0 enable corresponding
  231.                  text attribute bit)
  232.              13h horizontal PEL panning register
  233.              14h color select register
  234.         BH = color or attribute register value
  235. Notes: on MCGA, only BX = 0712h is supported
  236. ----------101001-----------------------------
  237. INT 10 - VIDEO - SET BORDER (OVERSCAN) COLOR (PCjr,EGA,VGA)
  238.         AX = 1001h
  239.         BH = border color (00h-3Fh)
  240. BUG: the original IBM VGA BIOS incorrectly updates the parameter save area
  241.      and places the border color at offset 11h of the palette table
  242.      rather than offset 10h
  243. ----------101002-----------------------------
  244. INT 10 - VIDEO - SET ALL PALETTE REGISTERS (PCjr,EGA,VGA)
  245.         AX = 1002h
  246.         ES:DX -> palette register list
  247.  
  248. Format of palette register list:
  249. Offset  Size     Description
  250.  00h   16 BYTEs  colors for palette registers 00h through 0Fh
  251.  10h      BYTE   border color
  252. ----------101003-----------------------------
  253. INT 10 - VIDEO - TOGGLE INTENSITY/BLINKING BIT (Jr, PS, TANDY 1000, EGA, VGA)
  254.         AX = 1003h
  255.         BL = new state
  256.              00h background intensity enabled
  257.              01h blink enabled
  258. Note: although there is no function to get the current status, bit 5 of
  259.       0040h:0065h indicates the state
  260. ----------101007-----------------------------
  261. INT 10 - VIDEO - GET INDIVIDUAL PALETTE REGISTER  (VGA)
  262.         AX = 1007h
  263.         BL = palette or attribute (undoc) register number (see AX=1000h)
  264. Return: BH = palette or attribute register value
  265. ----------101008-----------------------------
  266. INT 10 - VIDEO - READ OVERSCAN (BORDER COLOR) REGISTER  (VGA)
  267.         AX = 1008h
  268. Return: BH = border color (00h-3Fh)
  269. ----------101009-----------------------------
  270. INT 10 - VIDEO - READ ALL PALETTE REGISTERS AND OVERSCAN REGISTER (VGA)
  271.         AX = 1009h
  272.         ES:DX -> 17-byte buffer (see AX=1002h)
  273. ----------101010-----------------------------
  274. INT 10 - VIDEO - SET INDIVIDUAL DAC REGISTER (VGA/MCGA)
  275.         AX = 1010h
  276.         BX = register number
  277.         CH = new value for green (0-63)
  278.         CL = new value for blue (0-63)
  279.         DH = new value for red (0-63)
  280. ----------101012-----------------------------
  281. INT 10 - VIDEO - SET BLOCK OF DAC REGISTERS (VGA/MCGA)
  282.         AX = 1012h
  283.         BX = starting color register
  284.         CX = number of registers to set
  285.         ES:DX -> table of 3*CX bytes where each 3 byte group represents one
  286.                  byte each of red, green and blue (0-63)
  287. ----------101013-----------------------------
  288. INT 10 - VIDEO - SELECT VIDEO DAC COLOR PAGE (VGA)
  289.         AX = 1013h
  290.         BL = subfunction
  291.              00h select paging mode
  292.                  BH = 00h select 4 blocks of 64
  293.                  BH = 01h select 16 blocks of 16
  294.              01h select page
  295.                  BH = page number (00h to 03h) or (00h to 0Fh)
  296. Note: not valid in mode 13h
  297. ----------101015-----------------------------
  298. INT 10 - VIDEO - READ INDIVIDUAL DAC REGISTER (VGA/MCGA)
  299.         AX = 1015h
  300.         BL = palette register number
  301. Return: DH = red value
  302.         CH = green value
  303.         CL = blue value
  304. ----------101017-----------------------------
  305. INT 10 - VIDEO - READ BLOCK OF DAC REGISTERS (VGA/MCGA)
  306.         AX = 1017h
  307.         BX = starting palette register
  308.         CX = number of palette registers to read
  309.         ES:DX -> buffer (3 * CX bytes in size) (see also AX=1012h)
  310. Return: buffer filled with CX red, green and blue triples
  311. ----------101018-----------------------------
  312. INT 10 - VIDEO - undocumented - SET PEL MASK (VGA/MCGA)
  313.         AX = 1018h
  314.         BL = new PEL value
  315. ----------101019-----------------------------
  316. INT 10 - VIDEO - undocumented - READ PEL MASK (VGA/MCGA)
  317.         AX = 1019h
  318. Return: BL = value read
  319. ----------10101A-----------------------------
  320. INT 10 - VIDEO - GET VIDEO DAC COLOR-PAGE STATE (VGA)
  321.         AX = 101Ah
  322. Return: BL = paging mode
  323.              00h four pages of 64
  324.              01h sixteen pages of 16
  325.         BH = current page
  326. ----------10101B-----------------------------
  327. INT 10 - VIDEO - PERFORM GRAY-SCALE SUMMING (VGA/MCGA)
  328.         AX = 101Bh
  329.         BX = starting palette register
  330.         CX = number of registers to convert
  331. ----------1011-------------------------------
  332. INT 10 - VIDEO - TEXT-MODE CHARACTER GENERATOR FUNCTIONS (PS, EGA, VGA)
  333.         AH = 11h
  334. The following functions will cause a mode set, completely resetting
  335. the video environment, but without clearing the video buffer
  336.         AL = 00h, 10h: load user-specified patterns
  337.              ES:BP -> user table
  338.              CX  = count of patterns to store
  339.              DX  = character offset into map 2 block
  340.              BL  = block to load in map 2
  341.              BH  = number of bytes per character pattern
  342.         AL = 01h, 11h: load ROM monochrome patterns (8 by 14)
  343.              BL  = block to load
  344.         AL = 02h, 12h: load ROM 8 by 8 double-dot patterns
  345.              BL  = block to load
  346.         AL = 03h: set block specifier
  347.              BL  = block specifier
  348.                (EGA/MCGA) bits 0,1 = block selected by chars with attribute
  349.                                      bit 3=0
  350.                           bits 2,3 = block selected by chars with attribute
  351.                                      bit 3=1
  352.                     (VGA) bits 0,1,4 = block selected by attribute bit 3 = 0
  353.                           bits 2,3,5 = block selected by attribute bit 3 = 1
  354.         AL = 04h, 14h: load ROM 8x16 character set (VGA)
  355.              BL  = block to load
  356. The routines called with AL=1xh are designed to be called only immediately
  357. after a mode set and are similar to the routines called with AL=0xh,
  358. except that:
  359.       Page 0 must be active.
  360.       Bytes/character is recalculated.
  361.       Max character rows is recalculated.
  362.       CRT buffer length is recalculated.
  363.       CRTC registers are reprogrammed as follows:
  364.            R09 = bytes/char-1 ; max scan line (mode 7 only)
  365.            R0A = bytes/char-2 ; cursor start
  366.            R0B = 0            ; cursor end
  367.            R12 = ((rows+1)*(bytes/char))-1 ; vertical display end
  368.            R14 = bytes/char; underline loc
  369.                   (*** BUG: should be 1 less ***)
  370. ----------1011-------------------------------
  371. INT 10 - VIDEO - GRAPHICS-MODE CHARACTER GENERATOR FUNCTIONS (PS, EGA, VGA)
  372.         AH = 11h
  373.         AL = 20h: set user 8 by 8 graphics characters (INT 1F)
  374.                   ES:BP -> user table
  375.         AL = 21h: set user graphics characters
  376.                   ES:BP -> user table
  377.                   CX  = bytes per character
  378.                   BL  = row specifier
  379.                         00h user set
  380.                             DL = number of rows
  381.                         01h 14 rows
  382.                         02h 25 rows
  383.                         03h 43 rows
  384.         AL = 22h: ROM 8 by 14 set
  385.                   BL = row specifier (see above)
  386.         AL = 23h: ROM 8 by 8 double dot
  387.                   BL = row specifier (see above)
  388.         AL = 24h: load 8x16 graphics characters (VGA/MCGA)
  389.                   BL = row specifier (see above)
  390.         AL = 29h: load 8x16 graphics characters (Compaq Systempro)
  391.                   BL = row specifier (see above)
  392. Notes: these functions are meant to be called only after a mode set
  393. ----------101130-----------------------------
  394. INT 10 - VIDEO - GET FONT INFORMATION (EGA, MCGA, VGA)
  395.         AX = 1130h
  396.         BH = pointer specifier
  397.              00h INT 1Fh pointer
  398.              01h INT 43h pointer
  399.              02h ROM 8x14 character font pointer
  400.              03h ROM 8x8 double dot font pointer
  401.              04h ROM 8x8 double dot font (high 128 characters)
  402.              05h ROM alpha alternate (9 by 14) pointer (EGA,VGA)
  403.              06h ROM 8x16 font (MCGA, VGA)
  404.              07h ROM alternate 9x16 font (VGA only)
  405. Return: ES:BP = specified pointer
  406.         CX    = bytes/character
  407.         DL    = character rows on screen - 1
  408. ----------1012--BL10-------------------------
  409. INT 10 - VIDEO - ALTERNATE FUNCTION SELECT (PS, EGA, VGA, MCGA) - GET EGA INFO
  410.         AH = 12h
  411.         BL = 10h
  412. Return: BH = 00h color mode in effect (I/O port 3Dxh)
  413.              01h mono mode in effect (I/O port 3Bxh)
  414.         BL = 00h  64k bytes memory installed
  415.              01h 128k bytes memory installed
  416.              02h 192k bytes memory installed
  417.              03h 256k bytes memory installed
  418.         CH = feature bits
  419.         CL = switch settings
  420. ----------1012--BL20-------------------------
  421. INT 10 - VIDEO - ALTERNATE FUNCTION SELECT (PS,EGA,VGA,MCGA) - ALTERNATE PRTSC
  422.         AH = 12h
  423.         BL = 20h  select alternate print screen routine
  424. Notes: installs a PrtSc routine from the video card's BIOS to replace the
  425.        default PrtSc handler from the ROM BIOS, which usually does not
  426.        understand screen heights other than 25 lines
  427.        some adapters disable print-screen instead of enhancing it
  428. ----------1012--BL30-------------------------
  429. INT 10 - VIDEO - ALTERNATE FUNCTION SELECT (VGA) - SELECT VERTICAL RESOLUTION
  430.         AH = 12h
  431.         BL = 30h
  432.         AL = vertical resolution
  433.              00h 200 scan lines
  434.              01h 350 scan lines
  435.              02h 400 scan lines
  436. Return: AL = 12h if function supported
  437. ----------1012--BL31-------------------------
  438. INT 10 - VIDEO - ALTERNATE FUNCTION SELECT (VGA, MCGA) - PALETTE LOADING
  439.         AH = 12h
  440.         BL = 31h
  441.         AL = 00h enable default palette loading
  442.              01h disable default palette loading
  443. Return: AL = 12h if function supported
  444. ----------1012--BL32-------------------------
  445. INT 10 - VIDEO - ALTERNATE FUNCTION SELECT (VGA, MCGA) - VIDEO ADDRESSING
  446.         AH = 12h
  447.         BL = 32h
  448.         AL = 00h enable video addressing
  449.              01h disable video addressing
  450. Return: AL = 12h if function supported
  451. Desc:   Specifies whether the CPU should have access to video memory and the
  452.         display adapter's I/O registers
  453. ----------1012--BL33-------------------------
  454. INT 10 - VIDEO - ALTERNATE FUNCTION SELECT (VGA, MCGA) - GRAY-SCALE SUMMING
  455.         AH = 12h
  456.         BL = 33h
  457.         AL = 00h enable grey scale summing
  458.              01h disable grey scale summing
  459. Return: AL = 12h if function supported
  460. ----------1012--BL34-------------------------
  461. INT 10 - VIDEO - ALTERNATE FUNCTION SELECT (VGA) - CURSOR EMULATION
  462.         AH = 12h
  463.         BL = 34h
  464.         AL = 00h enable alphanumeric cursor emulation
  465.              01h disable alphanumeric cursor emulation
  466. Return: AL = 12h if function supported
  467. ----------1012--BL35-------------------------
  468. INT 10 - VIDEO - ALTERNATE FUNCTION SELECT (PS) - DISPLAY-SWITCH INTERFACE
  469.         AH = 12h
  470.         BL = 35h
  471.         AL = 00h initial adapter video off
  472.              01h initial planar video on
  473.              02h switch active video off
  474.              03h switch inactive video on
  475.              80h *UNDOCUMENTED* set system board video active flag
  476.         ES:DX -> buffer (128 byte save area if AL = 0, 2 or 3)
  477. Return: AL = 12h if function supported
  478. ----------1012--BL36-------------------------
  479. INT 10 - VIDEO - ALTERNATE FUNCTION SELECT (PS, VGA) - VIDEO REFRESH CONTROL
  480.         AH = 12h
  481.         BL = 36h
  482.         AL = 00h enable refresh
  483.              01h disable refresh
  484. Return: AL = 12h if function supported
  485. ----------1013-------------------------------
  486. INT 10 - VIDEO - WRITE STRING (AT and later,EGA)
  487.         AH = 13h
  488.         AL = write mode
  489.              bit 0: update cursor after writing
  490.                  1: string contains alternating characters and attributes
  491.         BH = page number
  492.         BL = attribute if string contains only characters
  493.         CX = number of characters in string
  494.         DH,DL = row,column at which to start writing
  495.         ES:BP -> string to write
  496. Notes: recognises CR, LF, BS, and bell
  497.        also available PC or XT with EGA or higher
  498.        HP 95LX only supports write mode 00h
  499. BUG: on the IBM VGA Adapter, any scrolling which may occur is performed on
  500.      the active page rather than the requested page
  501. ----------101A-------------------------------
  502. INT 10 - VIDEO - DISPLAY COMBINATION (PS,VGA/MCGA)
  503.         AH = 1Ah
  504.         AL = 00h read display combination code
  505. Return:          BL = active display code (see below)
  506.                  BH = alternate display code
  507.              01h set display combination code
  508.                  BL = active display code (see below)
  509.                  BH = alternate display code
  510. Return: AL = 1Ah if function was supported
  511.  
  512. Values for display combination code:
  513.   00h no display
  514.   01h monochrome adapter w/ monochrome display
  515.   02h CGA w/ color display
  516.   03h reserved
  517.   04h EGA w/ color display
  518.   05h EGA w/ monochrome display
  519.   06h PGA w/ color display
  520.   07h VGA w/ monochrome analog display
  521.   08h VGA w/ color analog display
  522.   09h reserved
  523.   0Ah MCGA w/ digital color display
  524.   0Bh MCGA w/ monochrome analog display
  525.   0Ch MCGA w/ color analog display
  526.   FFh unknown display type
  527. ----------101B-------------------------------
  528. INT 10 - VIDEO - FUNCTIONALITY/STATE INFORMATION (PS,VGA/MCGA)
  529.         AH = 1Bh
  530.         BX = implementation type
  531.              0000h return functionality/state information
  532.         ES:DI -> 64 byte buffer for state information (see below)
  533. Return: AL = 1Bh if function supported
  534.         ES:DI buffer filled with state information
  535.  
  536. Format of state information:
  537. Offset Size   Description
  538.  00h   DWORD  address of static functionality table (see below)
  539.  04h   BYTE   video mode in effect
  540.  05h   WORD   number of columns
  541.  07h   WORD   length of regen buffer in bytes
  542.  09h   WORD   starting address of regen buffer
  543.  0Bh   WORD   cursor position for page 0
  544.  0Dh   WORD   cursor position for page 1
  545.  0Fh   WORD   cursor position for page 2
  546.  11h   WORD   cursor position for page 3
  547.  13h   WORD   cursor position for page 4
  548.  15h   WORD   cursor position for page 5
  549.  17h   WORD   cursor position for page 6
  550.  19h   WORD   cursor position for page 7
  551.  1Bh   WORD   cursor type
  552.  1Dh   BYTE   active display page
  553.  1Eh   WORD   CRTC port address
  554.  20h   BYTE   current setting of register (3?8)
  555.  21h   BYTE   current setting of register (3?9)
  556.  22h   BYTE   number of rows
  557.  23h   WORD   bytes/character
  558.  25h   BYTE   display combination code of active display
  559.  26h   BYTE   DCC of alternate display
  560.  27h   WORD   number of colors supported in current mode
  561.  29h   BYTE   number of pages supported in current mode
  562.  2Ah   BYTE   number of scan lines active
  563.               (0,1,2,3) = (200,350,400,480)
  564.  2Bh   BYTE   primary character block
  565.  2Ch   BYTE   secondary character block
  566.  2Dh   BYTE   miscellaneous flags
  567.               bit 0 all modes on all displays on
  568.                   1 grey summing on
  569.                   2 monochrome display attached
  570.                   3 default palette loading disabled
  571.                   4 cursor emulation enabled
  572.                   5 0 = intensity; 1 = blinking
  573.                   6 PS/2 P70 plasma display (without 9-dot wide font) active
  574.                   7 reserved
  575.  2Eh  3 BYTEs reserved (00h)
  576.  31h   BYTE   video memory available
  577.               00h = 64K, 01h = 128K, 02h = 192K, 03h = 256K
  578.  32h   BYTE   save pointer state flags
  579.               bit 0 512 character set active
  580.                   1 dynamic save area present
  581.                   2 alpha font override active
  582.                   3 graphics font override active
  583.                   4 palette override active
  584.                   5 DCC override active
  585.                   6 reserved
  586.                   7 reserved
  587.  33h 13 BYTEs reserved (00h)
  588.  
  589. Format of Static Functionality Table:
  590. Offset Size    Description
  591.  00h   BYTE    modes supported #1
  592.                bit 0 to bit 7 = 1 modes 0,1,2,3,4,5,6 supported
  593.  01h   BYTE    modes supported #2
  594.                bit 0 to bit 7 = 1 modes 8,9,0Ah,0Bh,0Ch,0Dh,0Eh,0Fh supported
  595.  02h   BYTE    modes supported #3
  596.                bit 0 to bit 3 = 1 modes 10h,11h,12h,13h supported
  597.                bit 4 to bit 7 reserved
  598.  03h  4 BYTEs  reserved
  599.  07h   BYTE    scan lines supported
  600.                bit 0 to bit 2 = 1 if scan lines 200,350,400 supported
  601.  08h   BYTE    total number of character blocks available in text modes
  602.  09h   BYTE    maximum number of active character blocks in text modes
  603.  0Ah   BYTE    miscellaneous function flags #1
  604.                bit 0 all modes on all displays function supported
  605.                    1 grey summing function supported
  606.                    2 character font loading function supported
  607.                    3 default palette loading enable/disable supported
  608.                    4 cursor emulation function supported
  609.                    5 EGA palette present
  610.                    6 color palette present
  611.                    7 color paging function supported
  612.  0Bh   BYTE    miscellaneous function flags #2
  613.                bit 0 light pen supported
  614.                    1 save/restore state function 1Ch supported
  615.                    2 intensity blinking function supported
  616.                    3 Display Combination Code supported
  617.                  4-7 reserved
  618.  0Ch   WORD    reserved
  619.  0Eh   BYTE    save pointer function flags
  620.                bit 0 512 character set supported
  621.                    1 dynamic save area supported
  622.                    2 alpha font override supported
  623.                    3 graphics font override supported
  624.                    4 palette override supported
  625.                    5 DCC extension supported
  626.                    6 reserved
  627.                    7 reserved
  628.  0Fh   BYTE    reserved
  629. ----------101C-------------------------------
  630. INT 10 - VIDEO - SAVE/RESTORE VIDEO STATE (PS50+,VGA)
  631.         AH = 1Ch
  632.         AL = 00h return state buffer size
  633. Return: BX = number of 64-byte blocks needed
  634.              01h save video state
  635.                  ES:BX -> buffer
  636.              02h restore video state
  637.                  ES:BX -> buffer containing previously saved state
  638.         CX = requested states
  639.              bit 0 video hardware
  640.                  1 BIOS data areas
  641.                  2 color registers and DAC state
  642.               3-15 reserved
  643. Return: AL = 1Ch if function supported
  644.  
  645. Format of video hardware state:
  646. Offset  Size    Description
  647.  00h    BYTE    sequencer index register
  648.  01h    BYTE    CRTC index register
  649.  02h    BYTE    graphics controller index register
  650.  03h    BYTE    attribute controller index register
  651.  04h    BYTE    feature controller register
  652.  05h  4 BYTEs   sequencer registers
  653.  09h    BYTE    sequencer register 0
  654.  0Ah 25 BYTEs   CRTC registers 0-8
  655.  23h 16 BYTEs   palette registers 00h-0Fh
  656.  33h  4 BYTEs   attribute registers 10h-13h
  657.  37h  9 BYTEs   graphics controller registers 0-8
  658.  40h    BYTE    CRTC base address (low)
  659.  41h    BYTE    CRTC base address (high)
  660.  42h    BYTE    plane 0 latch
  661.  43h    BYTE    plane 1 latch
  662.  44h    BYTE    plane 2 latch
  663.  45h    BYTE    plane 3 latch
  664.  
  665. Format of DAC state:
  666. Offset  Size    Description
  667.  00h    BYTE    read/write mode DAC
  668.  01h    BYTE    pixel address
  669.  02h    BYTE    pixel mask
  670.  03h 768 BYTEs  color data (256 triples)
  671. 303h    BYTE    color select register
  672.  
  673.  
  674.  
  675. Memory:
  676. 0:410h    WORD    Bit 4-5:  Initial video mode
  677.                               0: EGA,VGA,PGA  1:40x25 color, 2: 80x25 color,
  678.                               3: 80x25 monochrome
  679. 0:449h    BYTE    Video current mode
  680. 0:44Ah    WORD    Video columns on screen
  681. 0:44Ch    WORD    Video page (regen buffer) size in bytes
  682. 0:44Eh    WORD    Video current page start address in regen buffer
  683. 0:450h  16 BYTEs  Video cursor position (col, row) for eight pages, 0 based
  684. 0:460h    WORD    Video cursor type, 6845 compatible, hi=startline, lo=endline
  685. 0:462h    BYTE    Video current page number
  686. 0:463h    WORD    Video CRT controller base address: color=03D4h, mono=03B4h
  687. 0:465h    BYTE    Video current setting of mode select register 03D8h/03B8h
  688. 0:466h    BYTE    Video current setting of CGA palette register 03D9h
  689. 0:484h    BYTE    Video EGA/MCGA/VGA rows on screen minus one
  690. 0:485h    WORD    Video EGA/MCGA/VGA character height in scan-lines
  691. 0:487h    BYTE    Video EGA/VGA control: [MCGA: =00h]
  692.                   bit  0:  =0 alphanumeric cursor emulation enabled, =1 not.
  693.                               When enabled the text mode cursor size (INT 10h,
  694.                               AH=01h) are translated to EGA/VGA size.
  695.                        1:  =0 for color or ECD monitor, =1 for mono monitor
  696.                        2:  =1 if to wait for display enable (what means this?)
  697.                        3:  =0 if EGA/VGA video system active, =1 if inactive
  698.                        4:  reserved
  699.                      6-5:  RAM on adapter = (this field + 1) * 64K
  700.                        7:  =1 if not to clear RAM (see INT 10h, AH=00h)
  701. 0:488h    BYTE    Video EGA/VGA switches: [MCGA: reserved]
  702.                   bits 0-3: configuration switches 4-1 (=0 on, =1 off)
  703.                             Values as read:
  704.                               0h Pri MDA,    Sec EGA+old color display 40 x 25
  705.                               1h Pri MDA,    Sec EGA+old color display 80 x 25
  706.                               2h Pri MDA,    Sec EGA+ECD normal mode (CGA
  707.                                              emulation)
  708.                               3h Pri MDA,    Sec EGA+ECD enhanced mode
  709.                               4h Pri CGA 40 x 25, Sec EGA mono display
  710.                               5h Pri CGA 80 x 25, Sec EGA mono display
  711.                               6h Pri EGA+old color display 40 x 25,  Sec MDA
  712.                               7h Pri EGA+old color display 80 x 25,  Sec MDA
  713.                               8h Pri EGA+ECD normal mode (CGA emul), Sec MDA
  714.                               9h Pri EGA+ECD enhanced mode,       Sec MDA
  715.                               Ah Pri EGA mono display,       Sec CGA 40 x 25
  716.                               Bh Pri EGA mono display,       Sec CGA 80 x 25
  717.                   bits 7-4: power-on state of feature connector bits 3-0
  718.    Note:  When bit4 of 40h:89h is 0, VGA emulates 350-line EGA if
  719.           this byte is x3h or x9h, otherwise emulates 200-line CGA in
  720.           400-line double scan. VGA resets this byte to x9h after the
  721.           mode set.
  722. 0:489h    BYTE    Video MCGA/VGA mode-set option control:
  723.                   bit 0:  [VGA] =1 if VGA active, =0 if not
  724.                           [MCGA] reserved, zero
  725.                       1:  =1 if grey scale summing enabled, =0 if disabled
  726.                       2:  =1 if mono display, =0 if color display
  727.                       3:  =0 if default palette loading enabled at mode set
  728.                       4:  [VGA]  =1 if to use 400-line mode at next mode set
  729.                                  =0 if to emulate EGA at next mode set
  730.                                     This bit set to 1 after the mode set.
  731.                           [MCGA] =1 use 400-line mode at next mode set
  732.                                  =0 emulate CGA, digital monitor, 200 lines,
  733.                                     8 x 8 text font at next mode set
  734.                                     Bit unchanged by mode set.
  735.                       5:  reserved
  736.                       6:  =1 if display switching enabled, =0 if disabled
  737.                   bits 7 and 4:
  738.                            0 0  350-line mode requested
  739.                            0 1  400-line mode at next mode set
  740.                            1 0  200-line mode requested
  741.                            1 1  reserved
  742.    Note:  Apparently VGA BIOS mode set disregards bit 7 and uses
  743.           byte 40h:88h to determine 200/350 selection when bit 4
  744.           is zero . Presumably bit 7 is a convenience for other
  745.           purposes. Bit 7 is reset to zero after the mode set.
  746. 0:48Ah    BYTE    Video [MCGA/VGA]: index into Display Combination Code table
  747. 0:4A8h    DWORD   Pointer to the Video Save Pointer Table (see below)
  748.  
  749.  
  750. Format of Video Save Pointer Table [EGA/VGA/MCGA only]:
  751. Offset  Size    Description
  752.   00h   DWORD   ptr to Video Parameter Table
  753.   04h   DWORD   ptr to Parameter Dynamic Save Area, else 0 [EGA/VGA only]
  754.   08h   DWORD   ptr to Alphanumeric Character Set Override, else 0
  755.   0Ch   DWORD   ptr to Graphics Character Set Override, else 0
  756.   10h   DWORD   [VGA only] ptr to Secondary Save Pointer Table, must be valid
  757.   14h   DWORD   reserved, zero
  758.   18h   DWORD   reserved, zero
  759. Note: table initially in ROM, copy to RAM to alter, then update 40h:A8h.
  760.  
  761. Format of Secondary Video Save Pointer Table [VGA only]:
  762. Offset  Size    Description
  763.   00h   WORD    Length of this table in bytes, including this word (1Ah)
  764.   02h   DWORD   ptr to Display Combination Code Table, must be valid
  765.   06h   DWORD   ptr to second Alphanumeric Character Set Override, else 0
  766.   0Ah   DWORD   ptr to User Palette Profile Table, else 0
  767.   0Eh   DWORD   reserved, zero
  768.   12h   DWORD   reserved, zero
  769.   16h   DWORD   reserved, zero
  770. Note: table initially in ROM, copy to RAM to alter, then alter Save Ptr Table.
  771.  
  772. Format of Video Parameter Table [EGA, VGA only]:
  773. An array of 23 [EGA] or 29 [VGA] elements, each element being 64 bytes long.
  774. Elements appear in the order:
  775.   00h-03h  Modes 00h-03h in 200-line CGA emulation mode
  776.   04h-0Eh  Modes 04h-0Eh
  777.   0Fh-10h  Modes 0Fh-10h when only 64kB RAM on adapter
  778.   11h-12h  Modes 0Fh-10h when >64kB RAM on adapter
  779.   13h-16h  Modes 00h-03h in 350-line mode
  780.   17h      VGA Modes 00h or 01h in 400-line mode
  781.   18h      VGA Modes 02h or 03h in 400-line mode
  782.   19h      VGA Mode  07h in 400-line mode
  783.   1Ah-1Ch  VGA Modes 11h-13h
  784.  
  785. Format of Video Parameter Table element [EGA, VGA only]:
  786. Offset  Size    Description
  787.   00h   BYTE    Columns on screen   (see 0:44Ah)
  788.   01h   BYTE    Rows on screen minus one  (see 0:484h)
  789.   02h   BYTE    Height of character in scan lines (see 0:485h)
  790.   03h   WORD    Size of video buffer   (see 0:44Ch)
  791.   05h  4 BYTEs  Values for Sequencer Registers 1-4
  792.   09h   BYTE    Value for Miscellaneous Output Register
  793.   0Ah 25 BYTEs  Values for CRTC Registers 00h-18h
  794.   23h 20 BYTEs  Values for Attribute Controller Registers 00h-13h
  795.   37h  9 BYTEs  Values for Graphics Controller Registers 00h-08h
  796.  
  797. Format of Video Parameter Table [MCGA only] {guesswork from inspection}:
  798.       16 triplet BYTEs of R,G,B DAC info for 16 colors;
  799.       An array of 11 elements, each element being 32 bytes long.
  800.       Elements appear in the order:
  801.         Modes 00h,01h in 200-line mode for digital displays
  802.         Modes 00h,01h in 400-line mode for analog displays
  803.         Modes 02h,03h in 200-line mode for digital displays
  804.         Modes 02h,03h in 400-line mode for analog displays
  805.         Modes 04h,05h in 200-line mode for digital displays
  806.         Modes 04h,05h in 400-line mode for analog displays
  807.         Mode  06h in 200-line mode for digital displays
  808.         Mode  06h in 400-line mode for analog displays
  809.         Mode  11h
  810.         Mode  13h in 200-line mode for digital displays
  811.         Mode  13h in 400-line mode for analog displays
  812.  
  813. Format of Video Parameter Table element [MCGA only]:
  814. Offset  Size    Description
  815.   00h   BYTE    Columns on screen         (see 0:44Ah)
  816.   01h   BYTE    Rows on screen minus one  (see 0:484h)
  817.   02h   BYTE    Height of character in scan lines (see 0:485h)
  818.   03h   WORD    Size of video buffer      (see 0:44Ch)
  819.   05h   WORD    ??? always zero
  820.   07h 21 BYTEs  Video data registers 00h-14h to port 3D5h indexed by 3D4h
  821.   1Ch   BYTE    PEL Mask to port 3C6h
  822.   1Dh   BYTE    CGA Mode Control to port 3D8h
  823.   1Eh   BYTE    CGA Border Control to port 3D9h
  824.   1Fh   BYTE    Extended Mode Control to port 3DDh
  825.  
  826. Format of Video Parameter Dynamic Save Area [EGA, VGA only]:
  827. Offset  Size    Description
  828.   00h 16 BYTEs  Last data written to Attribute Contr. Palette Registers 0-15
  829.   10h   BYTE    Last data written to Attribute Controller Overscan Register
  830.   11h-FFh       Reserved
  831. Note: Need for table was that EGA registers were write-only.
  832. Note: If default values (from the Video Parameter Table) are
  833.       over-ridden at a mode set by the VGA User Palette Profile
  834.       Table, then the Dynamic Save Area is updated with the
  835.       default values, not the User Profile ones.
  836.  
  837.